package com.topscomm.mis.cbb.pm.service.chain;

import com.topscomm.mis.cbb.pm.api.ITaskService;
import com.topscomm.pub.util.ConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;

/**
 * @description: 任务完成责任链
 * @author: wangxinhua
 * @date: 2023/6/16 10:17
 * @modify:
 */
public abstract class TaskCompleteHandler {
    @Autowired
    private ITaskService taskService;
    //责任链中的下一个元素
    private TaskCompleteHandler nextHandler;

    public void setNextHandler(TaskCompleteHandler nextHandler){
        this.nextHandler = nextHandler;
    }

    protected TaskCompleteHandler getNextHandler(){
        return this.nextHandler;
    }

    //完成任务方法,返回本级任务是否均已完成
    public abstract void completeTask(Map<String, Object> taskInfo);
}
